<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base target="center" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户管理</title>
<style type="text/css">
	table{ border-top:solid 2px #D1B4AB;
	margin-left:20px;
	margin-top:20px;
	width:80%;
	 border-collapse:collapse;
		}
	th{ height:30px; background-color:#EADDD9; color:#925F50;}
	#one{ border:#EADDD9;}
	#user{ width:12%;}
	#email{ width:40%;}
	#name{ width:10%;}
	#phone{ width:18%;}
	#sex{ width:5%;}
	#do{ width:15%;}
	td{ border:solid 1px #D1B4AB; text-align:center; margin:0px; height:40px;}
	em{ color: red;}
	.f{ border:none; border-top:solid 2px #D1B4AB; text-align:right;}
	.e{ text-align:left;}
	.u{ border-left-style:none;}
	.d{ border-right-style:none;}
	h3{ margin-bottom:0px;
	margin-left:10px;}
	a:link{ color:#00F; text-decoration:none;}
	a:visited{ color:#90C; text-decoration:underline;}
	a:hover{ text-decoration:underline; color:#F60;}
	a:active{ text-decoration:underline; color:#900;}
	input[type="button"]{ width:16px; height:23px; }
</style>
</head>

<body>
<h3><img  src="img/adsa.png"/> 用户管理</h3>
<hr size="2px" color="#FF9933" width="90%" align="left"/>
<table>
    <tr id="one">
    	<th id="user">用户名</th>
        <th id="name">真实姓名</th>
        <th id="sex">性别</th>
        <th id="email">Email</th>
        <th id="phone">手机</th>
        <th id="do">操作</th>
    </tr>
    <c:forEach items="${sessionScope.list}" var="bc">
    <tr>
    	<td class="u">${bc.account }</td>
        <td class="n">${bc.name }</td>
        <td class="s">${bc.sex }</td>
        <td class="e">${bc.email }</td>
        <td class="p">${bc.cellphone }</td>
        <td class="d"><a href="../MainServlet?option=update_q&ta=user&thisID=${bc.id }">修改</a>&nbsp;&nbsp;
        <a href="../MainServlet?option=delete&ta=user&thisID=${bc.id }&tpage=${sessionScope.tpage}">删除</a></td>
    </tr>  
    </c:forEach>  
    <tr><td class="f" colspan="6">
	    	<!-- 分页 -->
		    <b>共有用户<em>${sessionScope.allUser }</em>个</b>&nbsp;&nbsp;
		    <b>当前为<em>${sessionScope.tpage }</em>/<em>${sessionScope.apage }</em>页</b>
		    <!-- 首页 -->
		    <a href="../MainServlet?option=select&ta=user&tpage=1">首页</a>
		    <!-- 上一页 -->
		    <c:if test="${sessionScope.tpage>1 }">
				<a href="../MainServlet?option=select&ta=user&tpage=${sessionScope.tpage-1 }">上一页</a>    
		    </c:if>
		    <!-- 遍历每一页 -->
		    <c:forEach begin="1" end="${sessionScope.apage}" var="pg">
		 		<a href="../MainServlet?option=select&ta=user&tpage=${pg }">${pg }</a>   
		    </c:forEach>
		    <!-- 下一页 -->
		    <c:if test="${sessionScope.tpage<sessionScope.apage }">
				<a href="../MainServlet?option=select&ta=user&tpage=${sessionScope.tpage+1 }">下一页</a>    
		    </c:if>
		    <!-- 尾页 -->
		    <a href="../MainServlet?option=select&ta=user&tpage=${sessionScope.apage }">尾页</a>
	    </td></tr>

</table>


</body>
</html>
